package com.example.administrator.pomelostreet.mine;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.Switch;
import android.widget.Toast;

import com.example.administrator.pomelostreet.R;

public class SheZhi extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_she_zhi);
        Switch tongzhi= (Switch) findViewById(R.id.switch_tongzhi);
        tongzhi.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if(isChecked) {
                    //选中时 do some thing
                    Toast.makeText(SheZhi.this,"通知消息开启，您将及时法收到优惠信息呦！",Toast.LENGTH_SHORT).show();
                } else {
                    //非选中时 do some thing
                    Toast.makeText(SheZhi.this,"通知消息关闭，您将无法收到优惠信息呦！",Toast.LENGTH_SHORT).show();
                }
            }
        });
        findViewById(R.id.R_jiancha).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(SheZhi.this,"已经是最新版本",Toast.LENGTH_SHORT).show();            }
        });
        findViewById(R.id.r_qingli).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(SheZhi.this,"清理完毕",Toast.LENGTH_SHORT).show();            }
        });
    }
}
